package com.zfast.yugioh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zfast.forge.common.BaseService;
import com.zfast.forge.common.Page;
import com.zfast.yugioh.model.User;
import com.zfast.yugioh.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 用户
 *
 * @author zgn
 * @email 
 * @date 2022-06-09 10:10:33
 */
@Service("userService")
public class UserService extends BaseService<Integer, User> {
    public UserService(UserMapper mapper) {
        super(mapper);
    }

    @Resource
    UserMapper userMapper;

    public PageInfo<User> pageList(Page<User> page) {
        PageHelper.startPage(page.getNum(), page.getSize());
        List<User> list = userMapper.selectLikeUser(page.getData());
        PageInfo<User> pageInfo = new PageInfo(list);
        return pageInfo;
    }
}

